package five.autoview.fragment;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import five.autoview.R;
import five.autoview.activity.WenZiActivity;
import five.autoview.adapter.ListAdapter;

/**
 * A placeholder fragment containing a simple view.
 */
public class MainActivityFragment extends Fragment {

    private ListView listView;
    private ListAdapter listAdapter;
    private List<String> list;

    public MainActivityFragment() {
        list = new ArrayList<>();
        list.add("测试绘制文子和图");
        list.add("测试绘制间隔线");
        list.add("球的动画");
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_main, container ,false);

        listView = (ListView)view.findViewById(R.id.list);
        listAdapter = new ListAdapter(list, getActivity());
        listView.setAdapter(listAdapter);

        return view;


    }
}
